<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>

        <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                        template="./AdminTemplate.xhtml">
            <ui:define name="Title">
                <title>Change Password</title>
            </ui:define>

            <ui:define name="content">
                <h:form>
                    <div id="contenner" style="text-align: center;margin-top: 50px">
                        <!--                    <p:panel id="p1" rendered="{adminVihicleBean.emp.position==1}" header="Add Order" footer="order">-->

                        <h:panelGrid rendered="#{adminVihicleBean.emp.position==1 || adminVihicleBean.emp.position==2}">
                            <h:column>
                                <h1>Change Password </h1>
                                <div id="content" style="margin: 10px auto;width: 700px">
                                    <p:growl id="msgs" showDetail="true"/> 
                                    <table id="tblCusInfo">
                                        <tr>
                                            <td>
                                                <h4 style="width: 160px; color: #191919" >User Name :</h4>
                                            </td>
                                            <td>
                                                <p:inputText disabled="true" id="username" value="#{adminVihicleBean.emp.userName}" style="width: 250px">
                                                </p:inputText>
                                            </td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <h4 style="width: 160px; color: #191919" >Old Password :<strong style="color: red">*</strong> </h4>
                                            </td>
                                            <td>

                                                <p:password  id="password" value="#{adminVihicleBean.oldpasswordchangepassword}" style="width: 250px" required="true" requiredMessage="Please insert old password">
                                                    <f:validateLength for="password" minimum="5" />
                                                </p:password>
                                            </td>
                                            <td>
                                                <p:message  for="password" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <h4 style="width: 160px; color: #191919" >New Password :<strong style="color: red">*</strong> </h4>
                                            </td>
                                            <td>

                                                <p:password  id="newpassword" value="#{adminVihicleBean.newpasswordchangepassword}" style="width: 250px" required="true" requiredMessage="Please insert new password">
                                                    <f:validateLength for="newpassword" minimum="5" />
                                                </p:password>
                                            </td>
                                            <td>
                                                <p:message  for="newpassword" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td>
                                                <h:commandButton  action="#{adminVihicleBean.changePasswordchangepassword}" value="SUBMIT" style="width: 120px; height: 50px; font-size: 1.5em;font-weight: bold;" />
                                            </td>
                                            <td></td>
                                        </tr>
                                    </table>

                                </div>
                            </h:column>
                        </h:panelGrid>
                        <h:panelGrid rendered="#{adminVihicleBean.emp==null}">
                            Sorry you not position
                        </h:panelGrid>
                    </div>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
